﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointEdit.aspx.cs" Inherits="YiShi.KnowledgePoint.PointEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body style="font-size: 9pt;">
    <table id="MainTable">
        <tr>
            <td width="20%" align="right">
                名称
            </td>
            <td width="30%">
                <input name="Id" value="<%=id %>" type="hidden">
                <input name="Name" style="width: 100px;" value="<%=name %>" notallowempty="true">
            </td>
            <td width="20%" align="right">
                类型
            </td>
            <td width="30%">
                <%=typeHtml %>
            </td>
        </tr>
    </table>

    <script language="javascript">
        var actionType = "<%=returnActionType %>";
        $(function event() {
            //Init
            switch (actionType.toLowerCase()) {
                case "delete":
                case "view":
                    var $table = $("#MainTable");
                    var eles = $table.find("[name]");
                    for (var i = 0; i < eles.length; i++)
                        $(eles[i]).attr("disabled", true);
                    break;
            }
        });
        function __ReturnOk() {
            var obj = {};
            switch (actionType.toLowerCase()) {
                case "insert":
                case "update":
                    var $table = $("#MainTable");
                    var eles = $table.find("[name]");
                    for (var i = 0; i < eles.length; i++) {
                        var name = $(eles[i]).attr("name");
                        var value = $.trim($(eles[i]).val());
                        if ($(eles[i]).attr("notallowempty") == "true" && value == "") {
                            alert("字段[" + name + "]不允许为空！");
                            return;
                        }
                        obj[name] = value;
                    }
                    break;
            }
            return obj;
        }
    </script>

</body>
</html>
